#include<iostream>
#include<cstring>
using namespace std;
int main(){
	char s[100];
	gets(s);
	int len=strlen(s),a=0,b=0,c=0,d=0;
	for(int i=0;i<len;i++){
		if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z'){
			a++;
		}else if(s[i]>='0'&&s[i]<='9'){
			b++;
		}else if(s[i]==' '){
			c++;
		}else{
			d++;
		}
	}
	printf("%d %d %d %d\n",a,b,c,d);
	return 0;
}
